#pragma once
#include "Singleton.h"
#include "TTSWrapper.h"
#include "WaveRecorder.h"
#include "CMciWave.h"
#include "SSEvalMgr.h"

class CWPContext : public CSingleton<CWPContext>
{
public:
    CWPContext(void);
    ~CWPContext(void);

    BOOL Init();

    void Clear();

    void SetLevel(LPCTSTR levelName);
    LPCTSTR GetLevel();

    void SetTeachingMaterial(LPCTSTR materialName);
    LPCTSTR GetTeachingMaterial();

    void SetGrade(LPCTSTR gradeName);
    LPCTSTR GetGrade();

    void SetUnit(LPCTSTR unitName);
    LPCTSTR GetUnit();

    int GetSecondsByWord(LPCTSTR lpszWord);

    int GetSecondsBySentence(LPCTSTR lpszSent);

    void PlayMusicForStudyWord(int nGate, HWND hWnd = NULL);

    void PlayMusicForDing(HWND hWnd = NULL, BOOL bWait = FALSE);

    void PlayMusiceForVictory(HWND hWnd = NULL, BOOL bWait = FALSE);

    void PlayThreeSecForCountDown(HWND hWnd = NULL, BOOL bWait = FALSE);

    void PlayMusiceForFalse(HWND hWnd = NULL, BOOL bWait = FALSE);

    void PlayMusiceForTrue(HWND hWnd = NULL, BOOL bWait = FALSE);

    void PlayRecordFile(HWND hWnd = NULL, BOOL bWait = FALSE);

    DWORD SpeechRecognition_Start();

    void SpeechRecognition_Stop();

    void SingSoundPronEval(LPCTSTR strSpokenText, LPTSTR strErrMsg);

public:
    CTTSWrapper m_ttsWrapper;

    CWaveRecorder   m_WaveRecorder;
    CWave           m_mciWave;

    SSEvalMgr m_ssEvalMgr;

private:
    TCHAR m_szFileName[512];
    TCHAR m_szWPMainSec[32];
    TCHAR m_szValue[64];

    TCHAR m_szRecordFile[256];

};
